//
//  DHS2_SearchHistoryCell.m
//  Dresshere
//
//  Created by ZhangPeng on 2018/6/4.
//  Copyright © 2018年 张朋. All rights reserved.
//

#import "DHS2_SearchHistoryCell.h"

@interface DHS2_SearchHistoryCell()<TagViewDelegate>
@end

@implementation DHS2_SearchHistoryCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.historyView.delegate = self;
}

- (IBAction)clearAction:(id)sender {
    NSArray *arr = @[];
    [[NSUserDefaults standardUserDefaults] setObject:arr forKey:USER_SEARCH_HISTORY];
    [[NSUserDefaults standardUserDefaults] synchronize];
    
    [self routerEventWithName:@"clear_history" userInfo:nil];
}

#pragma mark - TagViewDelegate
- (void)handleSelectTag:(NSString *)keyWord{
    [self routerEventWithName:@"history_keyword_click" userInfo:@{@"key":keyWord}];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
